package com.wx.factorybean;

import com.wx.bean.People;
import org.springframework.beans.factory.SmartFactoryBean;

/**
 * MyFactoryBean 的 beanName 为 &myFactoryBean
 */
public class MyFactoryBean implements SmartFactoryBean<People> {

	/**
	 * getObject() 的 beanName 为 myFactoryBean
	 */
	@Override
	public People getObject() throws Exception {
		return new People("FactoryBean", 18);
	}

	@Override
	public Class<?> getObjectType() {
		return People.class;
	}

	/**
	 * 默认是懒加载，这路可以定义为热加载
	 */
	@Override
	public boolean isEagerInit() {
		return true;
	}
}
